home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import os
- import computerjanitor
- _ = computerjanitor.setup_gettext()
-
- class FileCruft(computerjanitor.Cruft):
- '''Cruft that is individual files.
-
- This type of cruft consists of individual files that should be
- removed. Various plugins may decide that various files are cruft;
- they can all use objects of FileCruft type to mark such files,
- regardless of the reason the files are considered cruft.
-
- When FileCruft instantiated, the file is identified by a pathname.
-
- '''
-
- def __init__(self, pathname, description):
- self.pathname = pathname
- st = os.stat(pathname)
- self.disk_usage = st.st_blocks * 512
- self.description = description
-
-
- def get_prefix(self):
- return 'file'
-
-
- def get_prefix_description(self):
- return _('A file on disk')
-
-
- def get_shortname(self):
- return self.pathname
-
-
- def get_description(self):
- return '%s\n' % self.description
-
-
- def get_disk_usage(self):
- return self.disk_usage
-
-
- def cleanup(self):
- os.remove(self.pathname)
-
-
-